package com.zhentao.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * @Date 2025/3/10 16:43
 * @Author neko
 **/
@Data
@EnableConfigurationProperties(MinioConfigProperties.class)
public class MinioConfig {
    @Autowired
    private MinioConfigProperties minioConfigProperties;

    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder()
                .endpoint(minioConfigProperties.getEndpoint())
                .credentials(minioConfigProperties.getAccesskey(),minioConfigProperties.getSecretKey())
                .build();
    }
}
